const CFG = require('./config');
const FUN = require('./comm/func');
const mqttConn = require('./utils/mqttConn');

//启动一个mqtt链接对象
mqttConn.newClient('admin.'+FUN.rand(12345678,99999999),(conn)=>{

  let args = process.argv;//命令行入参解析

  if(!args[2]) {
    console.log('没有参数 可选参数：wss,policy');
    return conn.end();
  }

  conn.publish('srv/debug',args[2]);//wss,policy

  conn.end();
})

